/*******************************************************************************
 * Copyright (c) Jonathan Buck - jonbuck16@gmail.com
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    jonbuck16@gmail.com - initial API and implementation
 *******************************************************************************/
package net.jonbuck.tassoo.ui.preference.provider;

import net.jonbuck.tassoo.model.impl.PriorityImpl;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.eclipse.jface.viewers.IElementComparer;

/**
 * 
 * 
 * @since 1.0.0
 */
public class ReferenceModelComparator implements IElementComparer {

	/**
	 * 
	 */
	public boolean equals(Object a, Object b) {
		if (a == null) {
			return false;
		}
		if (a == b) {
			return true;
		}
		if (a.getClass() != b.getClass()) {
			return false;
		}
		PriorityImpl lhs = (PriorityImpl) a;
		PriorityImpl rhs = (PriorityImpl) b;
		return new EqualsBuilder().append(lhs.getValue(), rhs.getValue()).isEquals();
	}

	/**
	 * 
	 */
	public int hashCode(Object element) {
		return 0;
	}

}
